import { defineComponent, reactive } from "vue";
import Draw from "./draw";
export default defineComponent({
  props: {
    data: {
      type: Object,
      require: true,
    },
  },
  components: {
    Draw,
  },
  setup(props) {
    const eggValue = { ...props.data };
    console.log(eggValue);
    
    const cdata = reactive({
      indicatorData: [
        { name: `今日抽蛋(${eggValue.whippingCount})`, max: 100 },
        { name: `昨日抽蛋(${eggValue.whippingCount - eggValue.diffWhippingCount})`, max: 100 },
        { name: `今日留窝(${eggValue.stayCount})`, max: 100 },
        { name: `昨日留窝(${eggValue.stayCount - eggValue.diffStayCount})`, max: 100 },
      ],
      dataBJ: [
        [
          eggValue.whippingCount,
          eggValue.whippingCount - eggValue.diffWhippingCount,
          eggValue.stayCount,
          eggValue.stayCount - eggValue.diffStayCount,
        ],
      ],
    });
    return () => {
      return (
        <div>
          <draw cdata={cdata} />
        </div>
      );
    };
  },
});
